package com.rfid.system.service.impl;

import java.util.List;

import com.rfid.common.utils.DateUtils;
import com.rfid.system.domain.response.TRfidDataDetailByItemNOResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rfid.system.mapper.TRfidDataDetailMapper;
import com.rfid.system.domain.TRfidDataDetail;
import com.rfid.system.service.ITRfidDataDetailService;
import com.rfid.common.core.text.Convert;

/**
 * RFID数据明细Service业务层处理
 *
 * @author fangchen
 * @date 2020-12-26
 */
@Service
public class TRfidDataDetailServiceImpl implements ITRfidDataDetailService {

    @Autowired
    private TRfidDataDetailMapper tRfidDataDetailMapper;

    /**
     * 查询RFID数据明细
     *
     * @param id RFID数据明细ID
     * @return RFID数据明细
     */
    @Override
    public TRfidDataDetail selectTRfidDataDetailById(Long id) {
        return tRfidDataDetailMapper.selectTRfidDataDetailById(id);
    }

    /**
     * 查询RFID数据明细列表
     *
     * @param tRfidDataDetail RFID数据明细
     * @return RFID数据明细
     */
    @Override
    public List<TRfidDataDetail> selectTRfidDataDetailList(TRfidDataDetail tRfidDataDetail) {
        return tRfidDataDetailMapper.selectTRfidDataDetailList(tRfidDataDetail);
    }

    /**
     * 新增RFID数据明细
     *
     * @param tRfidDataDetail RFID数据明细
     * @return 结果
     */
    @Override
    public int insertTRfidDataDetail(TRfidDataDetail tRfidDataDetail) {
        tRfidDataDetail.setCreateTime(DateUtils.getNowDate());
        return tRfidDataDetailMapper.insertTRfidDataDetail(tRfidDataDetail);
    }

    /**
     * 修改RFID数据明细
     *
     * @param tRfidDataDetail RFID数据明细
     * @return 结果
     */
    @Override
    public int updateTRfidDataDetail(TRfidDataDetail tRfidDataDetail) {
        tRfidDataDetail.setUpdateTime(DateUtils.getNowDate());
        return tRfidDataDetailMapper.updateTRfidDataDetail(tRfidDataDetail);
    }

    /**
     * 删除RFID数据明细对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTRfidDataDetailByIds(String ids) {
        return tRfidDataDetailMapper.deleteTRfidDataDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除RFID数据明细信息
     *
     * @param id RFID数据明细ID
     * @return 结果
     */
    @Override
    public int deleteTRfidDataDetailById(Long id) {
        return tRfidDataDetailMapper.deleteTRfidDataDetailById(id);
    }

    @Override
    public TRfidDataDetailByItemNOResponseVO selectTRfidDataDetailByItemNolList(TRfidDataDetail tRfidDataDetail) {
        return tRfidDataDetailMapper.selectTRfidDataDetailByItemNolList(tRfidDataDetail);
    }
}
